package edu.iyte.ceng316.ui.phonebook.right;

import javax.swing.JPanel;

import java.awt.Color;
import java.awt.GridBagLayout;
import javax.swing.JLabel;
import java.awt.GridBagConstraints;
import javax.swing.JTextField;
import javax.swing.border.MatteBorder;

import java.awt.Insets;

public class BottomPanel extends JPanel {
	private JLabel nameLabel;
	private JTextField nameTextField;
	private JLabel emailLabel;
	private JTextField emailTextField;
	private JLabel phoneLabel;
	private JTextField phoneTextField;
	private JLabel mobilePhone1Label;
	private JTextField mobilePhone1TextField;
	private JLabel mobilePhone2Label;
	private JTextField mobilePhone2TextField;

	/**
	 * Create the panel.
	 */
	public BottomPanel() {
		initialize();
	}
	
	public void initialize(){

		setBorder(new MatteBorder(10, 10, 10, 10,
				(Color) null));
		GridBagLayout gridBagLayout = new GridBagLayout();
		gridBagLayout.columnWidths = new int[] { 0, 0, 0 };
		gridBagLayout.rowHeights = new int[] { 0, 0, 0, 0, 0, 0 };
		gridBagLayout.columnWeights = new double[] { 0.0, 1.0, 1.0E-4 };
		gridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0,
				0.0, 1.0E-4 };
		setLayout(gridBagLayout);
		
		nameLabel = new JLabel("Name:");
		GridBagConstraints gbc_nameLabel = new GridBagConstraints();
		gbc_nameLabel.insets = new Insets(0, 0, 5, 5);
		gbc_nameLabel.anchor = GridBagConstraints.EAST;
		gbc_nameLabel.gridx = 0;
		gbc_nameLabel.gridy = 0;
		add(nameLabel, gbc_nameLabel);
		
		nameTextField = new JTextField();
		nameTextField.setColumns(30);
		GridBagConstraints gbc_nametextField = new GridBagConstraints();
		gbc_nametextField.insets = new Insets(0, 0, 5, 0);
		gbc_nametextField.fill = GridBagConstraints.HORIZONTAL;
		gbc_nametextField.gridx = 1;
		gbc_nametextField.gridy = 0;
		add(nameTextField, gbc_nametextField);
		
		emailLabel = new JLabel("E-Mail:");
		GridBagConstraints gbc_emailLabel = new GridBagConstraints();
		gbc_emailLabel.anchor = GridBagConstraints.EAST;
		gbc_emailLabel.insets = new Insets(0, 0, 5, 5);
		gbc_emailLabel.gridx = 0;
		gbc_emailLabel.gridy = 1;
		add(emailLabel, gbc_emailLabel);
		
		emailTextField = new JTextField();
		emailTextField.setColumns(30);
		GridBagConstraints gbc_emailtextField = new GridBagConstraints();
		gbc_emailtextField.insets = new Insets(0, 0, 5, 0);
		gbc_emailtextField.fill = GridBagConstraints.HORIZONTAL;
		gbc_emailtextField.gridx = 1;
		gbc_emailtextField.gridy = 1;
		add(emailTextField, gbc_emailtextField);
		
		phoneLabel = new JLabel("Phone:");
		GridBagConstraints gbc_phoneLabel = new GridBagConstraints();
		gbc_phoneLabel.anchor = GridBagConstraints.EAST;
		gbc_phoneLabel.insets = new Insets(0, 0, 5, 5);
		gbc_phoneLabel.gridx = 0;
		gbc_phoneLabel.gridy = 2;
		add(phoneLabel, gbc_phoneLabel);
		
		phoneTextField = new JTextField();
		phoneTextField.setColumns(30);
		GridBagConstraints gbc_phonetextField = new GridBagConstraints();
		gbc_phonetextField.insets = new Insets(0, 0, 5, 0);
		gbc_phonetextField.fill = GridBagConstraints.HORIZONTAL;
		gbc_phonetextField.gridx = 1;
		gbc_phonetextField.gridy = 2;
		add(phoneTextField, gbc_phonetextField);
		
		mobilePhone1Label = new JLabel("Mobile Phone 1:");
		GridBagConstraints gbc_mobilePhone1Label = new GridBagConstraints();
		gbc_mobilePhone1Label.anchor = GridBagConstraints.EAST;
		gbc_mobilePhone1Label.insets = new Insets(0, 0, 5, 5);
		gbc_mobilePhone1Label.gridx = 0;
		gbc_mobilePhone1Label.gridy = 3;
		add(mobilePhone1Label, gbc_mobilePhone1Label);
		
		mobilePhone1TextField = new JTextField();
		mobilePhone1TextField.setColumns(30);
		GridBagConstraints gbc_mobilePhone1TextField = new GridBagConstraints();
		gbc_mobilePhone1TextField.insets = new Insets(0, 0, 5, 0);
		gbc_mobilePhone1TextField.fill = GridBagConstraints.HORIZONTAL;
		gbc_mobilePhone1TextField.gridx = 1;
		gbc_mobilePhone1TextField.gridy = 3;
		add(mobilePhone1TextField, gbc_mobilePhone1TextField);
		
		mobilePhone2Label = new JLabel("Mobile Phone 2:");
		GridBagConstraints gbc_mobilePhone2Label = new GridBagConstraints();
		gbc_mobilePhone2Label.anchor = GridBagConstraints.EAST;
		gbc_mobilePhone2Label.insets = new Insets(0, 0, 0, 5);
		gbc_mobilePhone2Label.gridx = 0;
		gbc_mobilePhone2Label.gridy = 4;
		add(mobilePhone2Label, gbc_mobilePhone2Label);
		
		mobilePhone2TextField = new JTextField(30);
		GridBagConstraints gbc_mobilePhone2textField = new GridBagConstraints();
		gbc_mobilePhone2textField.fill = GridBagConstraints.HORIZONTAL;
		gbc_mobilePhone2textField.gridx = 1;
		gbc_mobilePhone2textField.gridy = 4;
		add(mobilePhone2TextField, gbc_mobilePhone2textField);
		
	}

	public JTextField getNameTextField() {
		return nameTextField;
	}

	public JTextField getEmailTextField() {
		return emailTextField;
	}

	public JTextField getPhoneTextField() {
		return phoneTextField;
	}

	public JTextField getMobilePhone1TextField() {
		return mobilePhone1TextField;
	}

	public JTextField getMobilePhone2TextField() {
		return mobilePhone2TextField;
	}

}
